From 53109c94ce3940dc7bae537a91358877609596f3 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 21 Feb 2004 13:48:44 +0000 Subject: [PATCH] (texinfo-insert-@item): Look for the current Texinfo environment, using the same method as in texinfo-insert-@end, and insert a space rather than a newline if point in a `table' environment. --- lisp/textmodes/texinfo.el | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lisp/textmodes/texinfo.el b/lisp/textmodes/texinfo.el index 3c5559897b4..8e5b94114a3 100644 --- a/lisp/textmodes/texinfo.el +++ b/lisp/textmodes/texinfo.el @@ -803,10 +803,18 @@ The default is not to surround any existing words with the braces." (texinfo-insert-@-with-arg "file" arg)) (defun texinfo-insert-@item () - "Insert the string `@item' in a Texinfo buffer." + "Insert the string `@item' in a Texinfo buffer. +If in a table defined by @table, follow said string with a space. +Otherwise, follow with a newline." (interactive) - (insert "@item") - (newline)) + (insert "@item" + (if (equal (ignore-errors + (save-excursion + (texinfo-last-unended-begin) + (match-string 1))) + "table") + ? ;space + ?\n))) (defun texinfo-insert-@kbd (&optional arg) "Insert a `@kbd{...}' command in a Texinfo buffer. -- 2.30.2